import axios from '@/utils/axios.js'
var pre = 'platform/admin/v1/government/'
var func = [ 'getList', 'getDic', 'create', 'update', 'destroy', 'searchUser' ]
var api = {}
func.forEach(value => {
  api[value] = pre + value
})

var getList = (params) => {
  return axios.get(api.getList, {params: params})
}

var getDic = (params) => {
  return axios.get(api.getDic, {params: params})
}

var create = (params) => {
  return axios.post(api.create, params)
}

var searchUser = (params) => {
  return axios.get(api.searchUser, {params: params})
}

var update = (params) => {
  return axios.put(api.update, params)
}

var destroy = (params) => {
  return axios.delete(api.destroy, {data: params})
}

export { getList, getDic, create, update, searchUser, destroy }
